package edu.ccut.saturn.studio.perspective;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class SaturnProjectPerspective implements IPerspectiveFactory {
	private static final String SATURNPROJECTPERSPECTIVE_ID = SaturnProjectPerspective.class.getName();
	private static final String JAVAPERSPECTIVE_ID = "org.eclipse.jdt.ui.JavaPerspective";
	private static final String RESOURCEPERSPECTIVE_ID = "org.eclipse.ui.resourcePerspective";
	private static final String SATURNVIEW_ID = "cn.edu.ccut.saturncontent.view";
	private static final String PROBLEMVIEW_ID = "org.eclipse.ui.views.ProblemView";
	private static final String PROPERTYSHEETVIEW_ID = "org.eclipse.ui.views.PropertySheet";
	private static final String CONSOLEVIEW_ID = "org.eclipse.ui.console.ConsoleView";
	private static final String TASKLISTVIEW_ID = "org.eclipse.ui.views.TaskList";
	private static final String PERSISTENCEVIEW_ID = "edu.ccut.saturn.studio.database.ui.DBConnectView";
	private static final String SATURNNEWWIZARD_ID = "com.saturn.saturnproject.ui.project.SaturnNewWizard";

	public void createInitialLayout(IPageLayout ipagelayout) {
		String s = ipagelayout.getEditorArea();
		IFolderLayout topLeftFolderlayout = ipagelayout.createFolder("topLeft",
				1, 0.3F, s);
		topLeftFolderlayout.addView(SATURNVIEW_ID);

		IFolderLayout bottomFolderlayout = ipagelayout.createFolder("bottom",
				4, 0.72F, s);
		bottomFolderlayout.addView(PROBLEMVIEW_ID);
		bottomFolderlayout.addView(CONSOLEVIEW_ID);
		bottomFolderlayout.addView(TASKLISTVIEW_ID);
		bottomFolderlayout.addView(PROPERTYSHEETVIEW_ID);
		bottomFolderlayout.addView(PERSISTENCEVIEW_ID);

		ipagelayout.addShowViewShortcut(SATURNVIEW_ID);
		ipagelayout.addShowViewShortcut(PROBLEMVIEW_ID);
		ipagelayout.addShowViewShortcut(PROPERTYSHEETVIEW_ID);
		ipagelayout.addShowViewShortcut(CONSOLEVIEW_ID);
		ipagelayout.addShowViewShortcut(PERSISTENCEVIEW_ID);

		ipagelayout.addNewWizardShortcut(SATURNNEWWIZARD_ID);

		ipagelayout.addPerspectiveShortcut(SATURNPROJECTPERSPECTIVE_ID);
		ipagelayout.addPerspectiveShortcut(JAVAPERSPECTIVE_ID);
		ipagelayout.addPerspectiveShortcut(RESOURCEPERSPECTIVE_ID);

	}

}
